import {px2rpx} from "../../../../utils/tool";
import {simpleGet} from "../../../../utils/request";

Component({
    properties: {
        marginBottom: {
            type: Number, value: 0,
            observer(data) {
                if (data) {
                    this.setData({
                        _marginBottom: px2rpx(data),
                    })
                }
            }
        },
        marginX: {
            type: Number, value: 0,
            observer(data) {
                if (data) {
                    this.setData({
                        _marginX: px2rpx(data),
                    })
                }

            }
        },
        radius: {type: String, value: 'fillet'},
        background: {type: String, value: 'none'},
        color: {type: String, value: '#333'},
    },
    data: {
        _marginBottom: 0,
        _marginX: 0,
        cates: [],
    },
    lifetimes: {
        attached() {
            simpleGet('/goodsCate/list').then(r => {
                this.setData({
                    cates: r.items,
                })
            })
        }
    },
    methods: {}
});
